package edu.predatorwars.shared.models;

import edu.predatorwars.shared.models.Player;
import edu.predatorwars.shared.models.Resource;
import edu.predatorwars.shared.models.Terrain;


public class Location 
{
	private final Terrain terrain;
	private final boolean startLocation;
	private Resource resource;
	private Player player;
	
	
	public Location(Terrain terrain, boolean startLocation)
	{
		this.terrain = terrain;
		this.startLocation = startLocation;
	}
	
	public Location(int TerrainType, boolean Traversable, boolean SightBlocked, boolean startLocation)
	{
		this.terrain = new Terrain(TerrainType, Traversable, SightBlocked);
		this.startLocation = startLocation;
	}
	

	

	
	/**
	 * Returns the Terrain details for this location.
	 * @return
	 */
	public Terrain getTerrain() 
	{
		return terrain;
	}
	
	/**
	 * Returns the resource at this location, null if none are here.
	 * @return
	 */
	public Resource getResource() 
	{
		return resource;
	}
	
	/**
	 * Returns the player currently positioned at this location.
	 * @return
	 */
	public Player getPlayer() 
	{
		return player;
	}
	
	/**
	 * Sets the Resource at this location.
	 * @return
	 */
	public void setResource(Resource resource) 
	{
		this.resource = resource;
	}
	
	/**
	 * Sets the player at this location.
	 * @return
	 */
	public void setPlayer(Player player) 
	{
		this.player = player;
	}
	
	/**
	 * Returns true iff this location can be a start location.
	 * @return
	 */
	public boolean isStartLocation()
	{
		return startLocation;
	}
}
